package Task35;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int size = scanner.nextInt();
            scanner.nextLine();
            String[] strings = new String[size];
            for (int i = 0; i < strings.length; i++) {
                String name = scanner.nextLine();
                if(name.contains(" ") || name.contains(",")){
                    strings[i]  = "\"" + name +  "\"";
                }else {
                    strings[i] = name;
                }
            }
            for (int i = 0; i < strings.length; i++) {
                System.out.print(strings[i]);
                if(i < strings.length - 1){
                    System.out.print(",");
                }
            }
            System.out.println();
        }
    }
}
